﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=6.0, user-scalable=yes">
	<?php echo $this->Html->charset(); ?>		
	<title><?php echo $title_for_layout; ?></title>
	<?php
		echo $this->Html->meta('icon');
		echo $this->Html->css(array('bootstrap','template','templatecom')); 
		echo $this->fetch('meta');
		echo $this->fetch('css');
		echo $this->fetch('script');
	?>
	
</head>
<body >
<div class="container-fluid" style="margin:0px; height:100%">
	<div class="row contests-new" style="height:100%">
		<div class="col-xs-2 col-sm-2">
			<div class=""></div>
		</div>
		<div class="col-xs-10 col-sm-10">
			<?php  
				//pr($data);
			
						if($data){ ?>
						<div class="data-contensts">
							<p class="show-question"> Câu hỏi số <?php echo $data['number']?></p>
							<div class="title-question-bottom"></div>
							<p style="padding-bottom:10px;position: relative;top: -8px;"><?php echo $data['name']?></p>
							<div class="border-bottom"></div>
							<form action = "" method="post">
							<div class="question-data">
									
									 <input type="hidden" name="numberNext" value="<?php  echo $data['nextNumber'];?>"/> 
									 <input type="hidden" name="idQuest" value="<?php echo $data['id']; ?>"/> 
									<input type="hidden" name="stop" value="<?php echo $data['stop']; ?>"/> 										 
								  
									<div class="content-question">
										<div>
												
												
												
												
											<ul class="nav nav-pills">
													<?php 
													$arr =  array('1'=>'A','2'=>'B','3'=>'C','4'=>'D','5'=>'E','6'=>'F');

													if($data['ansew']):
													$i=1;
													foreach($data['ansew'] as $an): ?>
													  <li>&nbsp;
														  <input style="float:left; margin-left:10px;" id="CategoryType<?php echo $i;?>" type="radio" name="ansewId" value="<?php echo $an['id'].','.$an['ruler'];?>" <?php if($i==1){?> checked="true"<?php }?> >
														  <label style="width:80%; float:left;text-align:left; cursor:pointer;font-weight:normal" for="CategoryType<?php echo $i ?>">&nbsp;<?php  echo $arr[$i]?>. &nbsp;<?php echo $an['name'] ?> </label></li>
													 <?php $i++;
													 endforeach; 
													 endif;
													 ?>
											<div style="margin-top:20px; text-align:center">
												<button type="submit" class="btn btn-primary" style="background:#a2c34e; border-color: #a2c34e;">&nbsp;&nbsp; XÁC NHẬN &nbsp;&nbsp;</button>
												
											</div>			 
											</ul>
											 <p id="show" style="float:right;color:red;"></p>	
										</div>
									</div>
							</div>
							</form >

					</div>
					<?php }?>
		</div>
	
	</div>	
			
		
</div>
	
</body>
<script >
    var i=<?php echo $timeTesst ?>;// la số thời gian tối đa. ở đây mình cho nó chạy từ 1 tới 100
    function time()
    {
        if(i>=0)
        {
            document.getElementById("show").innerHTML="Thời gian còn lại là: "+i+" giây";
            i--;
            setTimeout("time()",1000);
        }
        else
        {
            // gọi các hàm cần thực hiện ở đây
           // alert(" Đã Đếm Ngược Xong từ 100 về 0");
        }
    }
    
</script> 
</html>
